import { Inject, Injectable } from "@nestjs/common";
import {
  EnumMicroService,
  SysIntervalMsgType,
} from "../../../../../types/types";
import { NatsClientService } from "@app/nats-client";

@Injectable()
export class WithGatewayService {
  @Inject(NatsClientService)
  private natsClient: NatsClientService;

  sendMsg(msg) {
    console.log("dicom-server通过网关向前端，发出消息：", msg);
    this.natsClient.emit(SysIntervalMsgType.GATEWAY_FE_EXCHANGE_EVENT, {
      fromServerType: EnumMicroService.dicom,
      msg,
    });
  }
}
